<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    ul,
    ol,
    li {
      list-style: none;
    }
  </style>
</head>

<body>

  <div id="app">

    <p>time: {{time | formatDate}}</p>

  </div>

  <script src="./js/vue.js"></script>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {
        time: Date.now()
      },
      filters: { // 过滤器选项
        formatDate(v) {
          console.log(v);
          console.log(new Date(v));
          return new Date(v).toLocaleDateString()
        }
      }
    });


  </script>
</body>

</html>